package On_class.L0409;

import java.io.*;

public class InputString1 {
    public static void main(String[] args) {
        InputStreamReader isr;
        OutputStreamWriter osw;
        InputStream in;
        BufferedWriter bw=null;
        BufferedReader br=null;

        try {
            in=new FileInputStream("D:\\a.txt");
            isr=new InputStreamReader(in,"gbk");
            osw=new OutputStreamWriter(new FileOutputStream("a1.txt"),"utf-8");
            br=new BufferedReader(isr);
            bw=new BufferedWriter(osw);
            String line;
            while((line=br.readLine())!=null){
                bw.write(line);
                bw.newLine();
                bw.flush();
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            if(bw!=null){
                try {
                    bw.close();
                }catch (IOException E){
                    E.printStackTrace();
                }
            }
            if(br!=null){
                try {
                    br.close();
                }catch (IOException E){
                    E.printStackTrace();
                }
            }
        }
    }
}
